#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#include <signal.h>

void sig_usr(int signo) {
	if (signo == SIGUSR1)
		printf("received SIGUSR1\n");
	else if (signo == SIGUSR2)
		printf("received SIGUSR2\n");
	else		
		printf("received %d\n", signo);
}

int main(int argc, char const *argv[])
{
	if (signal(SIGUSR1, sig_usr) == SIG_ERR) {
		printf("can't catch SIGUSR1\n");
		return -1;
	}

	if (signal(SIGUSR2, sig_usr) == SIG_ERR) {
		printf("can't catch SIGUSR1\n");
		return -1;
	}

	for (; ;)
		pause();
	
	return 0;
}